import React, { Component } from 'react'
import { UdPage, UdPageHeader, udConfigProvider } from '@/lib'
import { BackTop } from 'antd'
import OrgTree from './component/OrgTree'

export default class Index extends Component<any,IOrganizationListState> {

  /** 滚动条容器 */
  protected pageContainer = udConfigProvider.ui.getPageContainer()
  
  constructor(props) {
    super(props)
    this.state = {
      title: '组织机构管理',
      subTitle: '',
    }
  }
  render() {
    return (
      
      <UdPage className="list-page">
        {
          this.state.title && <UdPageHeader title={this.state.title} subTitle={this.state.subTitle}
            onRefresh={this.query}
            affixProps={{ target: () => this.pageContainer }} />
        }
        <OrgTree />
        {this.pageContainer && <BackTop target={() => this.pageContainer} visibilityHeight={100} />}

      </UdPage>
    )
  }

  public query = () => {

  }
}

interface IOrganizationListState {
  title: string
  subTitle: string
}
